package cn.hiapi.config.security;

import cn.hiapi.basic.security.BasicFilter;
import cn.hiapi.basic.security.PermissionUrl;
import cn.hiapi.basic.token.Token;
import cn.hiapi.basic.token.service.TokenService;
import cn.hiapi.interfaces.DispatchContext;
import cn.hiapi.interfaces.security.LogData;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author AdinZ
 * @date 2022/12/12 1:06
 */
@Component
public class ShopkeeperFilter extends BasicFilter {
    public ShopkeeperFilter(DispatchContext dispatchContext, TokenService tokenService) {
        super(dispatchContext, tokenService);
    }

    @Override
    public List<PermissionUrl> getPermissionUrl() {
        return Lists.newArrayList();
    }

    @Override
    public LogData buildLog(Token token, HttpServletRequest request, HttpServletResponse response, LogData log) {
        return log;
    }

    @Override
    public boolean hasPermissions(Token<?> token, HttpServletRequest request, HttpServletResponse response) {
        return true;
    }
}
